<template>
  <view>
    <view>
      <web-view :src="src" :update-title="false"></web-view>
    </view>
  </view>
</template>

<script>
import { uploadUrl } from '@/common/setting.js';
export default {
  data() {
    return {
      // 			@钟冬民 ,懂鲜平台社区发布公约-----》h5/crownp.html
      // 懂鲜平台企业入驻协议----》h5/enterset.html
      // 懂鲜会员服务协义-----》h5/vipuser.html
      // 个人信息收集使用规则--》h5/user.html
      title: '',
      type: '',
      rule: '',
      src: ''

    }
  },
  onReady() {
    uni.setNavigationBarTitle({
      title: this.title
    });
  },
  onLoad(option) {
    console.log('%c [ option ]-26', 'font-size:13px; background:pink; color:#bf2c9f;', option)
    this.type = option.type
    // this.qiandao()
    if (this.type == 1) {
      this.src = uploadUrl + 'assets/protocol/crownp.html'
      this.title = '发布须知'
    } else if (this.type == 2) {
      this.src = uploadUrl + 'assets/protocol/vipuser.html'
      this.title = '会员须知'
    } else if (this.type == 3) {
      this.src = uploadUrl + 'assets/protocol/enterset.html'
      this.title = '入驻须知'
    } else if (this.type == 4) {
      this.src = uploadUrl + 'assets/protocol/user.html'
      this.title = '个人信息收集须知'
    }
    const timer = setTimeout(() => {
      clearTimeout(timer)
    }, 1000);

  },
  methods: {
    qiandao: function () {
      this.post('api/index/site', '', true).then(res => {
        console.log(res)
        if (res.code == 1) {
          if (this.type == 1) {
            this.rule = res.data.fbxz
          }
          if (this.type == 2) {
            this.rule = res.data.hyxy
          }
          if (this.type == 3) {
            this.rule = res.data.qyrzxy
          }
          if (this.type == 4) {
            this.rule = res.data.grxxxy
          }

        }
      })
    },
  }
}
</script>

<style>
</style>